<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2" />
    <g:set var="entityName" value="${message(code: 'activity.label', default: 'Activity')}" />
    <title>任务列表</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-header">
                <div class="page-header-title">
                    <h4>任务列表</h4>
                </div>

                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item">任务列表</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="page-body">
                <div class="card">
                    <div class="card-header">
                        <h5>任务列表</h5>

                        <div class="card-header-right">
                            <i class="icofont icofont-rounded-down"></i>
                        </div>
                    </div>

                    <div class="card-block dt-responsive">
                        <div class="table-responsive">
                            <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

                            <g:form method="POST" action="searchMyTeamTask">
                                <div class="row m-0">
                                    <div class="col-md-8 p-l-0">
                                        <div id="order-table_filter" class="dataTables_filter text-left">
                                            <label>搜索
                                                <input type="text" class="form-control" placeholder="状态" name="status" id="status" value="${params?.status}">
                                                <input type="text" class="form-control" placeholder="执行人" name="fullName" id="fullName" value="${params?.fullName}">
                                                <input type="text" class="form-control" placeholder="标题" name="name" id="name" value="${params?.name}">
                                            </label>

                                        </div>
                                    </div>
                                    <div class="col-md-4 p-r-0 dt-buttons text-right">
                                        <button class="btn btn-success btn-mini" type="submit"><i class="icofont icofont-search"></i>搜索</button>
                                        <button class="btn btn-warning btn-mini" type="button" id="resetBtn"><i class="icofont icofont-close"></i>重置</button>

                                    </div>
                                </div>
                            </g:form>

                                <table class="table table-striped  table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <g:sortableColumn property="activity" title="标题" />
                                            <g:sortableColumn property="activity" title="执行人" />
                                            <g:sortableColumn property="activity" title="所有者 " />
                                            <g:sortableColumn property="activity" title="状态 " />
                                            <g:sortableColumn property="activity" title="计划开始时间" />
                                            <g:sortableColumn property="activity" title="计划结束时间" />
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <g:each in="${teamTaskList}">
                                            <tr>
                                                <td><g:link controller="activity" action="show" id="${it?.activity.id}" class="firstTd">${it?.activity?.name}</g:link></td>
                                                <td>${it?.activity?.assignedTo?.fullName}</td>
                                                <td>${it?.activity?.user?.fullName}</td>
                                                <td>${it?.activity?.status}</td>
                                                <td><g:formatDate date="${it?.activity?.startTime}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                                <td><g:formatDate date="${it?.activity?.endTime}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                            </tr>
                                        </g:each>
                                    </tbody>
                                </table>
                                
                                <div class="dataTables_paginate">
                                    <div class="pagination">
                                        <g:paginate total="${activityTeamCount ?: 0}" params="${params}" />
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <g:javascript>
        $(function () { $("#resetBtn").click(function () { $("#status").val(""); $("#fullName").val(""); $("#name").val(""); }); });
    </g:javascript>
</body>

</html>